<template>
    <ul>
        <li v-for="(item,index) in this.content" :key="index" class="img">
            <h3 class="blogtitle"><a href="javascript:void 0" @click="topicInfo(item.id)" >{{item.title}}</a></h3>
            <div class="bloginfo"><span class="blogpic"><a href="javascript:void 0" @click="topicInfo(item.id)" title=""><img :src="getImg(item.img)"  class="i" /></a></span>
                <p>{{item.content}}</p>
            </div>
            <div class="autor">

                <span class="lm f_l type"><a href="/">{{item.type}}</a></span>
                <span class="dtime f_l">{{item.createTime}}</span>
                <span class="viewnum f_l">浏览（<a >{{item.view}}</a>）</span>

                <span class="pingl f_l">收藏（<a>{{ item.collect }}</a>）</span>
                <span class="f_r"><a :href="item.url" class="more">阅读原文</a></span>
                <i class="fa fa-user user"><a> {{item.auth}}</a></i>
            </div>
        </li>

    </ul>
</template>

<script>
    export default {
        name: "BlogCotent",
        props:{
            content:{
                type:Array
            }
        },
        methods:{
            topicInfo(blogId){
                let routeData = this.$router.resolve({ path: `/common/TopicInfo`,query:{id:blogId}});
                window.open(routeData.href, '_blank');
            },
            getImg(img){
                return process.env.IMG_URL + "/img/"+img;
            }
        }
    }
</script>

<style scoped>

</style>